#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int NumSum(int a){
	int s=0;
	while(a){
		s+=a%10;
		a=a/10; 
	}
	return s;
}

bool isDisappear(int num, vector <int> &v){
	vector <int> ::iterator p;
	bool ret=true;
	for( p=v.begin(); p!=v.end(); p++ ){
		if( *p==num )
		ret=false; 
	}
	return ret; 
}

int main(){
	int n;
	scanf("%d",&n);
	vector <int> v;
	vector <int> ::iterator p;
	for(int i=0; i<n; i++){
		int a;
		scanf("%d",&a);
			if( isDisappear(NumSum(a),v) ){
				v.push_back(NumSum(a));
			}
	}
	sort(v.begin(),v.end());
	printf("%d\n",v.size());
	for(p=v.begin(); p<v.end()-1; p++ ){ printf("%d ",*p); }
	printf("%d",*p);
	return 0;
}
